package com.lantosec.hmrp.modules.warning.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.lantosec.hmrp.core.mvc.BaseVO;
import com.lantosec.hmrp.modules.warning.entity.WarningMessage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 预警信息 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-05-20
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="WarningMessage对象", description="预警信息")
public class WarningMessageVO extends BaseVO<WarningMessage> {
    private static final long serialVersionUID = 1L;


    public WarningMessageVO(WarningMessage entity){
        this.ruleId = entity.getRuleId();
        this.dataMode = entity.getDataMode();
        this.smsTemplateId = entity.getSmsTemplateId();
        this.messageTemplate = entity.getMessageTemplate();
    }

    @Override
    public WarningMessage convertToEntity(){
        return new WarningMessage(this);
    }


    @ApiModelProperty(value = "预警规则ID")
    private String ruleId;

    @ApiModelProperty(value = "数据方式(1公共2部门3个人)")
    private Integer dataMode;

    @ApiModelProperty(value = "短信通知模板ID")
    private Integer smsTemplateId;

    @ApiModelProperty(value = "信息模板内容")
    private String messageTemplate;

    @TableField(exist = false)
    private Integer flag;


}
